package org.csc.sss.datacore.service;

import java.util.ArrayList;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class SmsService {


    /**
     * 获取模板keys
     * @param tmplStr
     * @return
     */
    public static List<String> getTplKeys(String tmplStr) {
        Pattern p = Pattern.compile("\\{([a-zA-Z0-9]+)\\}");
        Matcher m = p.matcher(tmplStr);
        List<String> keys = new ArrayList<String>();
        while(m.find()) {
            keys.add(m.group(1));
        }
        return keys;
    }
}
